package com.lenovo.hawk.controller;

import com.lenovo.hawk.pojo.Comp;
import com.lenovo.hawk.pojo.Customer;
import com.lenovo.hawk.service.CompService;
import com.lenovo.hawk.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class mytestController {

    @Value("${spring.profiles.active}")
    private String ACTIVE_PROFILE;

    @RequestMapping(value = "/myTest")
    public String myTest(){
        System.out.println("往事随风");
        return ACTIVE_PROFILE;
    }

    @Autowired
    CustomerService customerService;

    @Autowired
    CompService compService;

    @RequestMapping(value = "/test01")
    public String mybatisTest01(){
        System.out.println(ACTIVE_PROFILE);
        Integer dataResult =  compService.findAll();
        System.out.println(dataResult);
        return "测试构建项目请求成功";
    }

    @RequestMapping(value = "/test02")
    public String mybatisTest02(){
        System.out.println(ACTIVE_PROFILE);
        Integer data = customerService.findAll();
        System.out.println(data);
        return "测试构建项目请求成功";
    }

}
